home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / script / tabkey < prev    next >
Encoding:
Text File  |  2002-10-28  |  3.3 KB  |  99 lines

  1. #------------------------------------------------------------------------------#
  2. # updated for 2.2.2
  3. # This keeps track of the nicks of people you MSG.  You can then
  4. # just hit the tab key ^I to flip through the list of people
  5. # you sent MSGs to.  
  6. # Assign tk.msgmax to the number of nicknames you wish to store
  7. # Modified by Chetnik (s902211@yallara.cs.rmit.oz.au)
  8. #         and Daemon  (frechett@spot.colorado.edu)
  9. # It will now keep unique nicknames in the list ordered from the most recent
  10. # message received or sent to the oldest message received or sent.
  11. # Ctrl R will flip thru the list backwards (Reverse).
  12. # Crtl-X Ctrl-X deletes the currently displayed or current nick from the list.
  13. # /addnick <nickname list>    will add the nicknames to the list.
  14. # /nicklist             will show the current list of names
  15. # If a nickname which has 'never' existed is messaged, it will not be added to
  16. # the list.
  17.  
  18. #echo ***
  19. #echo *** Just try ''TC''!
  20. #echo ***
  21.  
  22. # searches thru list forwards (tab) or backwards (ctrl R)
  23. bind ^I parse_command ^tk.getmsg 1 $tk.msglist
  24. bind ^R parse_command ^tk.getmsg -1 $tk.msglist
  25. # Delete current nickname or currently displayed nickname from list
  26. bind ^X^X parse_command tk.delnick
  27. # shows all the current nicknames in the list.
  28. alias nicklist echo *** Nickname List: $tk.msglist
  29. # Adds nicknames to the list.. 
  30. alias addnick if ([$1]) { addnick $1- };tk.addmsg $0 $tk.msglist
  31. # Set this to the max number of nickname you want on the list at a time
  32. @ tk.msgmax = 10
  33.  
  34. # From here down are internal aliases and 'ON's.
  35. # This script uses SERIAL NUMBER  #55
  36. # keeps list of unique nicks from newest message to oldest message.
  37. alias tk.addmsg {
  38.     @ tk.matched = rmatch($0 $^\1-)
  39.     if (tk.matched)
  40.     {
  41.         @ tk.msglist = [$(0-${tk.matched-1}) $(${tk.matched+1}-)]
  42.     }
  43.     #else
  44.     {    @ tk.msglist = [$(0-${tk.msgmax-1})] }
  45.     @ tk.msgcnt = 0
  46.     ^assign -tk.matched
  47. }
  48. # searches thru list forwards or backwards. ($0==1==forward),($0==-1==back)
  49. alias tk.getmsg {
  50.     @ tk.msgcnt = tk.msgcnt + [$0]
  51.     if ( #tk.msglist < tk.msgcnt ) {@ tk.msgcnt = 1}
  52.     if (tk.msgcnt <= 0) {@ tk.msgcnt =  #tk.msglist}
  53.     @ tk.junk = K ## [msg]
  54.     parsekey erase_line
  55.     xtype -l $tk.junk $($tk.msgcnt) 
  56. }
  57. # some initialisation.  You can comment these out if you want to.
  58. # ^on #-401 55 * if ([$AUTO_WHOWAS] != [ON]) { ^whowas $1 }
  59. # ^on ^406 * {
  60. #    ^assign tk.msglist $notword($rmatch($1 $tk.msglist) $tk.msglist)
  61. #    if ([$AUTO_WHOWAS] == [ON]) { echo *** $1- }
  62. #}
  63.     
  64.  
  65. # Adds nick to list when message is sent or received. Doesn't effect output.
  66. on #-send_msg 55 * ^tk.addmsg $0 $tk.msglist
  67. on #-msg 55 * ^tk.addmsg $0 $tk.msglist
  68. on #-send_dcc_chat 55 * ^tk.addmsg \=$0 $tk.msglist
  69. on #-dcc_chat 55 * ^tk.addmsg \=$0 $tk.msglist
  70.  
  71. # deletes current nick from list
  72. alias tk.delnick {
  73.     if (tk.msgcnt == 0)
  74.     {
  75.         echo *** Nickname: $word(0 $tk.msglist) removed.
  76.         @ tk.msglist = [$notword(1 $tk.msglist)]
  77.     }
  78.     {
  79.         echo *** Nickname: $word(${tk.msgcnt-1} $tk.msglist) removed.
  80.         @ tk.msglist = [$notword($tk.msgcnt $tk.msglist)]
  81.     }
  82.     parsekey erase_line
  83. }
  84. # The $notword() function.  
  85. alias notword {
  86.     if ([$0] > 0)
  87.     {
  88.     if (([$0] > 1) && ([$0] < #))
  89.         { @ nw.sep = [ ] }
  90.         { @ nw.sep = [] }
  91.         
  92.     @ function_return = [$(1-${[$0]-1})] ## [$nw.sep] ## [$(${[$0]+1}-)]
  93.     }
  94.     {
  95.         @ function_return = [$1-]
  96.     }
  97. }
  98. #------------------------------------------------------------------------------#
  99.